/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.model.rdf;

import java.net.URI;

import net.groupme.exceptions.UpdateFailedException;
import net.groupme.model.Resource;
import net.groupme.model.dao.rdf.StatementDAO;

/**
 * created on Jun 27, 2007
 * 
 * This class implements the {@link Statement} interface by redirecting all requests to
 * an underlying {@link StatementDAO}.
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: fabian $
 * 
 * @version $Revision: 1.5 $ $Date: 2007-09-19 12:10:24 $
 */
public class StatementImpl implements Statement{
	
	/** the underlying DAO object to which all requests are redirected */
	private StatementDAO dao = null;
	
	/**
	 * Creates a new StatementImpl instance.
	 * @param statementDAO the underlying DAO instance which reflects all requests to the data store
	 */
	public StatementImpl(StatementDAO statementDAO){
		this.dao = statementDAO;
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#getId()
	 */
	public String getId() {
		return this.dao.getId();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#getDatatype()
	 */
	public String getDatatype() {
		return dao.getDatatype();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#getDescription()
	 */
	public String getDescription() {
		return this.dao.getDescription();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#getLabel()
	 */
	public String getLabel() {
		return this.dao.getLabel();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#getObject()
	 */
	public String getObject() {
		return dao.getObject();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#getProperty()
	 */
	public String getProperty() {
		return dao.getProperty();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#getSubject()
	 */
	public Resource getSubject() {
		return dao.getSubject();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#getURI()
	 */
	public URI getURI() {
		return this.dao.getURI();
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#setDatatype(java.lang.String)
	 */
	public boolean setDatatype(String datatype) {
		return dao.setDatatype(datatype);		
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#setDescription(java.lang.String)
	 */
	public void setDescription(String description) throws UpdateFailedException {
		this.dao.setDescription(description);
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#setLabel(java.lang.String)
	 */
	public void setLabel(String label) {
		this.dao.setLabel(label);
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#setObject(java.lang.String)
	 */
	public boolean setObject(String object) {
		return dao.setObject(object);
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#setProperty(java.lang.String)
	 */
	public boolean setProperty(String property) {
		return dao.setProperty(property);
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.rdf.Statement#setSubject(net.groupme.model.Resource)
	 */
	public boolean setSubject(Resource resource) {
		return dao.setSubject(resource);
	}
}
